<script setup>
import { onMounted } from "vue";
import { user } from "@/constants/mock.js";
import NavBar from "@/components/NavBar/index.vue";
import TabBar from "@/components/TabBar/index.vue";

function navigateToSetting() {
  uni.navigateTo({
    url: "/pages/Me/Settings/index",
  });
}

function navigateToStore() {
  uni.navigateTo({
    url: "/pages/Me/Store/index",
  });
}

function navigateToVerify() {
  uni.navigateTo({
    url: "/pages/Me/Verify/index",
  });
}

function navigateToMyBalance() {
	uni.navigateTo({
	  url: "/pages/Me/Balance/index",
	});
}

function navigateToRentOrder() {
	uni.navigateTo({
	  url: "/pages/Me/RentOrder/index",
	});
}

</script>

<template>
  <div class="container">
    <NavBar></NavBar>
    <div class="me-content">
      <div class="user-info" @click="navigateToMyBalance">
        <div class="user-avatar">

        </div>
        {{ user.name }}
      </div>
      <div class="verify">
        请完成司机认证
        <image src="@/static/icon/chevron-right-large.png" class="setting-item-icon" @click="navigateToVerify"/>
      </div>
      <div class="setting-item" @click="navigateToRentOrder">租车订单
        <image src="@/static/icon/chevron-right-large.png" class="setting-item-icon"/>
      </div>

      <div class="setting-item" @click="navigateToStore">商城
        <image src="@/static/icon/chevron-right-large.png" class="setting-item-icon"/>
      </div>
      <div class="setting-item" @click="navigateToSetting">设置
        <image src="@/static/icon/chevron-right-large.png" class="setting-item-icon"/>
      </div>
    </div>
    <!-- <TabBar :tabIndex="2"></TabBar> -->
  </div>
</template>

<style scoped>
.container {
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 20px;
  background: linear-gradient(180deg, #c3e4b3 0%, #f5fff0 100%);
}

.me-content {
  display: flex;
  flex-direction: column;

  gap: 20px;
  margin-top: 40px;
}

.user-info {
  height: 82px;
  display: flex;
  align-items: center;
  background-color: #f7fff3;
  border-radius: 10px;
  padding: 0 20px;
  gap: 8px;
  box-sizing: border-box;
}

.verify {
  height: 118px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #f7fff3;
  border-radius: 10px;
  padding: 0 20px;
  box-sizing: border-box;
}

.setting-item {
  width: 100%;
  height: 54px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 16px;
  background-color: #f7fff3;
  border-radius: 10px;
  padding: 0 20px;
  box-sizing: border-box;
}

.user-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background-color: #D9D9D9; /* 可以根据需要更改颜色 */
}


.setting-item-icon {
  width: 18px;
  height: 18px;
}
</style>
